﻿Public Class frmConect

    Public Event Conectar(ByVal Server As String, ByRef Conectado As Boolean)

    Private Sub frmConect_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        txtServer.Text = My.Settings.Servidor
    End Sub

    Private Sub btnConectar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnConectar.Click
        Barra.Style = ProgressBarStyle.Marquee
        Me.Enabled = False

        Dim Conectado As Boolean = False
        RaiseEvent Conectar(txtServer.Text, Conectado)

        If Conectado Then
            Close()
        End If

        Me.Enabled = True
        Barra.Style = ProgressBarStyle.Blocks
    End Sub
End Class